<?php

include_once($cfgPaths['lib'].'cms/type/cmsEditType.o.inc.php');

class cmsEditBulletListType extends cmsEditType {

 function registerFields () {
   $map[] = $this->name.'text';
   $map[] = $this->name.'class';
   $map[] = $this->name.'type';
   $this->map = &$map;
 }

 function render_html () {
  global $udba,$cfgPaths,$env;
  include_once($cfgPaths['lib/dba'].'dbaCSS.o.inc.php');
  $dba = base_ApplicationContext::getInstance()->getAccessFactory()->getInstanceOf(base_AccessFactory::$CSS);
  $css = $dba->getSiteRelevant($env->getSession('s_currentSite'));
  $fu = 'zaehle(this,this.form.'.$this->name.'_anzahl,65535)';
  $html  = '<div class="xicstypeplugin">'."\n";
  $html .= '              <h3>'.$this->descr.':</h3>'.$this->showFields()."\n";
  $html .= '              <div class="xicstypetools">Type: <select tabindex="'.$this->sender->getNextTabindex($this->name.'type').'" name="'.$this->name.'type">'."\n";
  $types = array(array('disc','Punkt'),array('circle','Kreis'),array('square','Quadrat')
  		,array('1','Zahlen'),array('a','kleine Buchstaben'),array('A','gro&szlig;e Buchstaben'),array('i','kleine r&ouml;mische Zahlen'),array('I','gro&szlig;e r&ouml;mische Zahlen'));
  for ($i=0;$i<count($types);$i++)
  {
  	$html .= '              <option value="'.$types[$i][0].'"';
  	if ($types[$i][0] == $this->getValue($this->name.'type')) $html .= ' selected="selected"';
  	$html .= '>'.$types[$i][1]."</option>\n";
  }		  					  
  $html .=  ' 				</select>
  		  				CSS Klasse: <select tabindex="'.$this->sender->getNextTabindex($this->name.'class').'" name="'.$this->name.'class">';
  $html .= '              <option value="">Keine'."</option>\n";
  for ($i=0;$i<count($css);$i++)
  {
  	$html .= '              <option value="'.$css[$i]['name'].'">'.$css[$i]['name']."</option>\n";
  }		  					
  $html .= '		  </select></div>'."\n";
  $html .= '              <textarea tabindex="'.$this->sender->getNextTabindex($this->name.'text').'" name="'.$this->name.'text" cols="60" rows="20" onfocus="'.$fu.'" onclick="'.$fu.'" onchange="'.$fu.'" onKeydown="'.$fu.'"'."\n";
  $html .= '               onKeyup="'.$fu.'">'.htmlspecialchars($this->getValue($this->name.'text')).'</textarea><br>'."\n";
  $html .= '               Zeichen:<input name="'.$this->name.'_anzahl" value="'.strlen($this->getValue($this->name.'text')).'" size="5"> (max 65535)'."\n";
  $html .= '</div><!-- / type bulletList -->'."\n";
  return $html;
 }

 function render_javascript () {
 }

}


?>